import { http } from '@/utils/request'

// 获取用户vip等级记录详细信息
export const getUserVipLevel = () => http.get('/user/vipLevelConfig/front/list')
// 用户信息和企业信息(苗商信息
export const fetchuserInfo = (data) => http.post('/system/user/front/getMerchantInfo', data)

// 获取苗木详情
export const getById = (data) => http.get(`/es/pushProduct/front/getById`, data)
// 获取用户信息和企业信息(苗商信息)
export const getMerchantInfo = (data) => http.post('/system/user/front/getMerchantInfo', data)
// 收藏苗商
export const favorite = (data) => http.post('/user/favorite/front/favorite', data)
// 取消收藏苗商
export const unFavorite = (data) => http.post('/user/favorite/front/unFavorite', data)
// 批量新增求购苗木
export const batchAdd = (data) => http.post('/es/pullProduct/front/batchAdd', data)
// 查询全部城市
export const getAllCity = () => http.get('/system/district/getAllCity', {})
// 查询全部城市-树形结构
export const getAll = () => http.get('/system/district/getAll', {})
// 查询基础商品列表
export const baseProduct = (data) => http.get('/system/baseProduct/front/pageList', data)
// 查询基础商品分类属性--发布
export const getProductCategoryAttributes = (data) =>
  http.get('/system/baseProduct/front/getProductCategoryAttributes', data)
// 查询基础商品分类属性--求购
export const getProductCategoryAttributesV2 = (data) =>
  http.get('/system/baseProduct/front/getProductCategoryAttributesV2', data)
// 查询基础商品分类属性--求购
export const getProductCategoryAttributesV3 = (data) =>
  http.get('/system/baseProduct/front/getProductCategoryAttributesV3', data)
// 字典查询
export const dictData = (data) => http.get(`/system/dict/data/type/${data}`)
// 批量上传图片
export const upload = (data) => http.post(`/resource/oss/batchUpload`, data, { isUpload: true })
// 新增发布苗木
export const pushProductAdd = (data) => http.post('/es/pushProduct/front/add', data)
// 查询登录人企业苗圃列表
export const nurseryList = () => http.get('/es/nursery/front/list', {})
// 热门搜索
export const searchHot = () => http.get('/es/base/front/search/hot', {})
// 搜索历史
export const searchHistory = () => http.get('/es/base/front/search/history', {})
// 删除历史
export const delHistory = () => http.get('/es/base/front/search/delHistory', {})
// 搜索发布苗木
export const pushProductQuery = (data) => http.post('/es/pushProduct/front/query', data)
// 查询全部分类
export const listAll = (data) => http.get('/system/category/front/listAll', data)
// 查询求购苗木
export const pullProductQuery = (data) => http.post('/es/pullProduct/front/query', data)
// 我的求购
export const selfQuery = (data) => http.post('/es/pullProduct/front/self/query', data)
// 停止求购
export const selfStop = (data) => http.get('/es/pullProduct/front/self/stop', data)
// 再次求购
export const selfAgain = (data) => http.get('/es/pullProduct/front/self/again', data)
// 删除求购
export const batchRemove = (data) => http.post('/es/pullProduct/front/batchRemove', data)
// 查询求购苗木详情
export const pullProductGetById = (data) => http.get('/es/pullProduct/front/getById', data)
// 查询最近30天发布求购数量
export const latelyPullNum = () => http.post('/es/pullProduct/front/latelyPullNum')
// 认证的图片上传
export const uploadOcr = (data) => http.post(`/resource/ocr/upload`, data, { isUpload: true })
// 新增身份认证
export const personalAuth = (data) => http.post('/user/authApply/front/apply', data)
// 查询认证状态
export const getPersonalApplyInfo = () => http.get('/user/authApply/front/getApplyInfo')
// 企业申请：
export const companyAuthApply = (data) => http.post('/user/companyAuthApply/front/apply', data)
// 企业认证状态查询
export const getCompanyApplyInfo = () => http.get('/user/companyAuthApply/front/getApplyInfo')
// 企业联系人
export const getCompanyContactPhone = (data) =>
  http.get('/user/companyAuth/front/getCompanyContactPhone', data)
// 新增意见反馈
export const addFeedback = (data) => http.post('/system/feedback/front/add', data)
// 获取苗木详情
export const queryById = (data) => http.get('/system/information/front/queryById', data)
// 获取用户信息
export const userInfo = (data) => http.get('/system/user/front/getUserInfo', data)
// 邀请信息（含我的邀请码、是否已绑定）
export const getInviteInfo = () => http.get('/user/invite/front/get', {})
// 绑定他人邀请码
export const bindInvite = (data) => http.post('/user/invite/front/bind', data)
// 苗商已发布苗木list
export const companyDetail = (data) => http.post('/es/pushProduct/front/companyDetail/getAll', data)
// 苗圃
export const listByUserId = (data) => http.get('/user/nursery/front/listByUserId', data)
// 苗圃
export const byUserId = (data) => http.get('/es/nursery/front/byUserId', data)
